package org.six11.ss.server;

import java.io.PrintWriter;

import org.six11.ss.server.bean.Person;
import org.six11.ss.shared.Message;
import org.six11.util.adt.MultiState;

/**
 * 
 *
 * @author Gabe Johnson <johnsogg@cmu.edu>
 */
public class RoomWhoHandler extends AppletMessageHandler {

  /**
   * @param state
   */
  public RoomWhoHandler(MultiState state) {
    super(state);
  }

  /**
   * 
   */
  @Override
  public void handle(Message m, String sessionID, PrintWriter out) {
    Person person = getPersonBySession(sessionID);
    RoomHandler rh = (RoomHandler) getHandler("room");
    rh.sendRoomMembership(person.getRoom().getId() + "", person.getId() + "");
  }

}
